module.exports=function(success,error){
    const mongoose=require('mongoose')
    const {HOST,PORT,NAME}=require('./config')
    mongoose.set('strictQuery',true)
    mongoose.connect(`mongodb://${HOST}:${PORT}/${NAME}`)

    mongoose.connection.once('open',()=>{
        success();
    })

    mongoose.connection.on('error',()=>{
        error();

    })

    
}